package zuoye.ershouche.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import zuoye.ershouche.common.Result;
import zuoye.ershouche.entity.User;
import zuoye.ershouche.entity.UserCollectCars;
import zuoye.ershouche.mapper.UserCollectCarsMapper;
import zuoye.ershouche.service.UserCollectCarsService;

@RestController
@Api(tags = "用户收藏")
public class UserCollectCarsController {

    @Autowired
    UserCollectCarsService userCollectCarsService;

    @PostMapping("/addUserCollectCars")
    @ApiOperation(value = "新建收藏用汽车信息id")
    public Result addUser(@RequestBody UserCollectCars userCollectCars) {
        return Result.success(userCollectCarsService.insertUserCollectCars(userCollectCars));
    }

    @DeleteMapping("/deleteUserCollectCars ")
    @ApiOperation(value = "删除收藏用id")
    public Result deleteUser(@RequestParam Integer userid, @RequestParam Integer carid) {
        return Result.success(userCollectCarsService.deleteUserCollectCarsById(userid, carid));
    }

}
